package com.neusoft.databus.common.connection;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * JDBC connection configuration
 *
 * @author sunchf
 */
@Getter
@Setter
@ToString
public class WangguanConnection extends AbstractConnection {
    private static final long serialVersionUID = 1L;

    private String host;
    private int port = 21;
    private String loginName;
    private String loginPass;
    private String path;
    private String tmpPath = System.getProperty("java.io.tmpdir");

    @Override
    public int hashCode() {
        return (this.host + this.port + this.loginName + this.loginPass).hashCode();
    }

    @Override
    public boolean equals(final Object o) {
        if (o instanceof WangguanConnection) {
            return this.hashCode() == ((WangguanConnection) o).hashCode();
        }
        return false;
    }

    @Override
    public WangguanConnection asUsedConnection() {
        return this;
    }
}
